<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app"></div>
  <script src="../node_modules/@vue/reactivity/dist/reactivity.global.js"></script>
  <script>
    const { ref, shaollRef, effect } = VueReactivity;
  
    let name = ref('Tom');

    console.log(name)
    const app = document.querySelector('#app');

    // 收集 effect 回调函数中收集的响应式数据的依赖
    effect(() => {
      app.innerHTML = name.value;
    })

    setTimeout(() => {
      name.value = 'Jerry';
    }, 1000)
    
  </script>
</body>
</html>